package com.neusoft.elmboot.mapper;

import org.apache.ibatis.annotations.*;
import com.neusoft.elmboot.po.User;
/**
 * 用户
 * Mapper
 */
@Mapper
public interface UserMapper {
    @Select("select * from user where userId=#{userId} and password=#{password}")
    public User getUserByIdByPass(User user);

    @Select("select count(*) from user where userId=#{userId}")
    public int getUserById(String userId);

    @Insert("insert into user values(#{userId},#{password},#{userName},#{userSex},null,1,0.00,0)")
    public int saveUser(User user);

    @Update("update user set point = #{npoint} where userId=#{userId}")
    public void updatePoint(@Param("userId") String userId, @Param("npoint") Double cpoint);

    @Update("update user set hasEnvelope = 1 where userId=#{userId}")
    public void updateEnvelope(String userId);

    @Update("update user set hasEnvelope = 0 ")
    public void updateAllEnvelop();
    @Select("select userImg from user where userId=#{userId}")
    public String getProfileByUserId(User user);
}